﻿using FreeSql.DataAnnotations;
using System;
using System.ComponentModel;
using TomNet.FreeSql.Base;

namespace TomNet.Demo.Entity.Entities
{
    [Description("用户登录表")]
    [Table(Name = "UserLogin")]
    [Index("uk_user_username", nameof(LoginName), true)]
    public class UserEntity : EntityLongBase//, ISoftDeletable
    {
        public UserEntity()
        {
            IsDelete = false;
            DeletedTime = DateTime.Parse("1900-01-01 00:00:00.000");
        }

        [Description("登录账号")]
        [Column(StringLength = 50, IsNullable = false)]

        public string LoginName { get; set; }

        [Description("登录密码")]
        [Column(StringLength = 36, IsNullable = false)]
        public string Password { get; set; }

        [Description("行锁")]
        [Column(IsVersion = true)]
        public long VersionRow { get; set; }

        [Description("逻辑删除")]
        public bool IsDelete { get; set; } = false;

        [Description("逻辑删除时间")]
        [Column(IsNullable = false)]
        public DateTime DeletedTime { get; set; } = DateTime.Parse("1900-01-01 00:00:00.000");
    }
}
